﻿@{
    ViewBag.Title = "自定义页面";
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
}
@model List<UcAsp.Net.Model.UserDefined>
<div class="container-fluid">
    <div class="row-fluid">
        <button id="addcontent" class="btn btn-danger">
            添加</button>
        <div class="span12">
            <div class="widget-box">
                <div class="widget-title">
                    <span class="icon"><i class="icon-th"></i></span>
                    <h5>
                        自定义页面</h5>
                </div>
                <div class="widget-content nopadding">
                    <table class="table table-bordered table-striped">
                        <thead>
                            <tr>
                                <th>
                                    文件名
                                </th>
                                <th>
                                    标题
                                </th>
                                <th>
                                    操作
                                </th>
                            </tr>
                        </thead>
                        <tbody>
                            @foreach(UcAsp.Net.Model.UserDefined u in Model)
                        {
                                <tr>
                                    <td>
                                    @u.DefinedName
                                    </td>
                                    <td>
                                    @u.DefinedTitle
                                    </td>
                                    <td>
                                    <span class="btn edit" data-id="@u.DefinedName">编辑</span>
                                    </td>
                                </tr>
                            }
                        </tbody>
                        <tfoot>
                            <tr>
                                <td colspan="3">
                                </td>
                            </tr>
                        </tfoot>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    $(document).ready(function () {
        $("#addcontent").click(function () {
            $.get("/Admin/DefinedManager", function (dataResult) {
                $.facebox(dataResult, "ucaspfacebox");
            });
        })
        $(".edit").click(function () {
            $.get("/Admin/DefinedManager?Name=" + $(this).attr("data-id"), function (dataResult) {
                $.facebox(dataResult, "ucaspfacebox");
            });
        })
    })
</script>
